<?php
class BussinessController extends Zend_Controller_Action
{
    private $_modelBussiness = null;
    
    public function init(){
        parent::init();
        $this->_modelBussiness = new Application_Model_Bussiness();
    }
    
    public function showListHotBusinessAction()
    {
        //Get param get number row per page and convert to integer
        $numberRowPerPage = (int) $this->_request->getParam('number-row-per-page', Zend_Registry::get('config')->rows_per_one_page);

        //Get select for products from model product
        $selectBussiness = $this->_modelBussiness->getListHotBussiness();

        //Paging
        $paginator = Zend_Paginator::factory($selectBussiness);
        //Get config for number row in page
        $paginator->setItemCountPerPage($numberRowPerPage);
        $paginator->setPageRange(Zend_Registry::get('config')->number_page_in_paging);

        //Set view
        $this->view->listBussiness = $paginator;
    }
}